<template>
  <router-view></router-view>
  <van-tabbar v-model="active" v-if="['#/login','#/register','#/detail'].indexOf(hash) == -1">
    <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
    <van-tabbar-item icon="search" to="/super">广场</van-tabbar-item> 
    <van-tabbar-item icon="setting-o" to="/user">我的</van-tabbar-item>
  </van-tabbar>
    <div class="">   </div> 
</template>

<script>
import {mapState,mapMutations} from 'vuex';  
export default {
  name: 'App',
  data(){
    return {
      active:0, 
    }
  },
  created(){
  
  },
  computed:{...mapState(['hash'])},
 
  methods: { ...mapMutations(['SetHash']),
  },
  mounted(){ 
     var map={
       "#/home":0, "#/super":1, "#/user":2,
     }
     this.active = map[location.hash]
     this.SetHash(location.hash)
  },
  activated(){
     console.log("activated调用了");
    debugger
    this.SetHash(location.hash)
  }

}
/*

https://vant-contrib.gitee.io/vant/#/zh-CN/tabbar
https://blog.csdn.net/goutinga/article/details/109062735
ui
https://fzdebug.5upm.com/doc-view-2.html
*/
</script>
